import axios from '@/utils/axios';


export function permissionList(params) {
  return axios({
    url: '/sysPermission/list',
    method: 'get',
    params
  });
}


// 根据角色id获取权限
export function permissionByRoleId(params) {
  return axios({
    url: '/sysPermission/permissionsByRoleId',
    method: 'get',
    params
  });
}

// 获取所有权限
export function getAllPermissions() {
  return axios({
    url: '/sysPermission/getAllPermissions',
    method: 'get'
  });
}

// 添加权限
export function addOnePermission(data) {
  return axios({
    url: '/sysPermission/add',
    method: 'post',
    data
  });
}

// 权限详情
export function permissionDetail(params) {
  return axios({
    url: '/sysPermission/detail/'+params,
    method: 'get'
  });
}

// 修改权限
export function permissionUpdate(data) {
  return axios({
    url: '/sysPermission/update',
    method: 'post',
    data
  });
}

// 根据id删除
export function permissionDelete(params) {
  return axios({
    url: '/sysPermission/delete/'+params,
    method: 'delete'
  });
}
